package bma.common.langutil.log.filelog;

public class PerformanceFileLogTask extends CommonFileLogTask {

	public PerformanceFileLogTask() {
		super();
	}

	public PerformanceFileLogTask(String logId, StringBuffer message) {
		super(logId, message);
	}

	public PerformanceFileLogTask(String logId) {
		super(logId);
	}

	private long beginTime;

	public PerformanceFileLogTask begin() {
		beginTime = System.currentTimeMillis();
		return this;
	}

	public PerformanceFileLogTask end() {
		long now = System.currentTimeMillis();
		double sp = (now - beginTime);
		super.addMessage("sp", Double.toString(sp/1000));
		return this;
	}
}
